﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting;
using System.Security.Permissions;
using System.Text;

namespace THenu.Reflection
{
    /// <summary>
    /// 测试类
    /// </summary>
    class Program
    {
 
        /// <summary>
        /// 测试类
        /// </summary>
        public class Person
        {
            public string Name { get; set; }
            public int Age { get; set; }
        }
        /// <summary>
        /// 测试类
        /// </summary>
        class TestClass : MarshalByRefObject
        {
        }
        /// <summary>
        /// 测试远程对象
        /// </summary>
        [SecurityPermission(SecurityAction.LinkDemand)]
        public static void Main()
        {
            MemberInfo fInfo= RefTool.GetPropertyInfo<Person>(p=>p.Name);
            TestClass obj = new TestClass();

            RemotingServices.SetObjectUriForMarshal(obj, "testUri");
            RemotingServices.Marshal(obj);

            Console.WriteLine(RemotingServices.GetObjectUri(obj));


            FlagTest.FlagsAttributeExample();

            Console.ReadLine();
        }
    }
}
